----------------------------------------------------
-- Welcome to the Wonderful World of MobileLua! --
----------------------------------------------------
--
-- MobileLua is a programming tool for mobile devices. 
-- The text in this window is a Lua program that can 
-- run on your mobile.
--

-- This is a simple painting program!

function OnInit()
  SetColor(255, 255, 255)
  FillRect(0, 0, ScreenWidth(), ScreenHeight())
  UpdateScreen()
end

function OnTouchDown(x, y)
  SetColor(0, 0, 0)
  FillRect(x - 15, y - 15, 30, 30)
  UpdateScreen()
end

function OnTouchDrag(x, y)
  OnTouchDown(x, y)
end